﻿<local:DocumentBase x:Class="WPFExcelReport.BAKAB45AV95"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                      
                    Loaded="Window_Loaded"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    Title="Planning"  
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch"
     >
    <local:DocumentBase.Resources>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource x:Key="wASTAMMViewSource" Source="{Binding Path=WASTAMM, Source={StaticResource iNTEXDataSet}}" />
        <CollectionViewSource x:Key="aBPOSViewSource" Source="{Binding Path=ABPOS, Source={StaticResource iNTEXDataSet}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <WrapPanel Grid.Row="0" Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" HorizontalAlignment="Left" Margin="10,0,0,0" Name="btnQuery"
                            VerticalAlignment="Center" Width="75" Click="btnQuery_Click" />
            <Button Content="仅生成报表"  Height="23" HorizontalAlignment="Left" Margin="10,0,0,0" Name="btnReport"
                            VerticalAlignment="Top" Width="75"
                                Click="btnReport_Click" />
            <Button Content="打印报表" Height="23" Margin="10,0,0,0"  Name="btnPrint" Width="90" Click="btnPrint_Click"/>
            <Button Content="浏览数据" Height="23" Margin="10,0,0,0"  Name="btnPrintPreview" Width="90" Click="btnPrintPreview_Click"/> 
        </WrapPanel>
        <StackPanel Grid.Row="1" >
            <Expander Header="查询条件" Name="zoneQueryCond"  IsExpanded="True" ExpandDirection="Up"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" >
                        <WrapPanel>
                            <Label Content="生产单号码:"    Width="120" HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                            <TextBox Name="txtKRS" Width="30" HorizontalAlignment="Left" Background="Pink" FontSize="18" Text=""  CharacterCasing="Upper" AcceptsTab="False" MaxLength="2" />
                            <TextBox Name="txtLFD" Width="90" HorizontalAlignment="Left" Background="Beige" Text="" FontSize="18" Height="30" AcceptsTab="False" CharacterCasing="Upper" MaxLength="6" Panel.ZIndex="1" />
                            <TextBox Name="txtPOS" Width="60" HorizontalAlignment="Left" Background="YellowGreen" FontSize="18" Text="" Height="30"  AcceptsTab="False" MaxLength="3" Panel.ZIndex="2" />
                            <Label Content="品种:"  Width="90"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                            <TextBox Name="txtArticle" Text="{Binding ElementName=wAARTComboBox, Path=Text}" Width="144"  HorizontalAlignment="Left" Background="Azure" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
                            <Label Content="外加工厂编号："    Width="91" HorizontalAlignment="Left" Margin="3"  FontSize="14" VerticalAlignment="Center" Height="18" />
                            <TextBox Name="txtFACTORY" Width="112" HorizontalAlignment="Left" Background="Beige" Text="" FontSize="18" Height="30" AcceptsTab="False" CharacterCasing="Upper" MaxLength="6" Panel.ZIndex="1" />
                            <CheckBox Content="完成单" Height="15" Name="txtERLKZ" Margin="20,10,0,0" Background="WhiteSmoke" />
                        </WrapPanel>
                        <Grid DataContext="{StaticResource wASTAMMViewSource}" HorizontalAlignment="Left" Margin="10,10,0,0" Name="grid1" VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="品种选择:"  Width="120" FontSize="18" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                            <ComboBox DisplayMemberPath="WAART"
                                      SelectedValuePath="WAART"
                                      FontSize="18"
                                      IsEditable="True"
                                      IsTextSearchEnabled="True"
                                      IsTextSearchCaseSensitive="False"
                                      Background="AliceBlue"
                                      Grid.Column="1" Grid.Row="0" Height="30" HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="3" Name="wAARTComboBox" VerticalAlignment="Center" Width="200">
                                <ComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </ComboBox.ItemsPanel>
                            </ComboBox>
                        </Grid>
                    </StackPanel>
                </Grid>
            </Expander>
            <Expander Header="数据" Name="zoneDataList"  IsExpanded="True"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                <fd:FilteringDataGrid AutoGenerateColumns="False" EnableRowVirtualization="True"  
                                            ItemsSource="{Binding Source={StaticResource aBPOSViewSource}}" 
                                              x:Name="MasterDg" 
                                              CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="1000"
                                              Height="400" 
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=KDKUNDNA}" Header="客户" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=ABPLIEFDAT}" Header="预计回轴" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=ABPNEUDAT}" Header="下单" MinWidth="40" Width="SizeToCells"  /> 
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="品种" MinWidth="160" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=STDBATCHNO}" Header="指定对缸号" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=BSFBEZ}" Header="浆纱颜色" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=VWORDERNUM}" Header="浆纱单" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=ABPSTARTDAT}" Header="预计开始" MinWidth="40" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=JSACTDATE}" Header="实际开始" MinWidth="40" Width="SizeToCells"  />                        
                        <DataGridTextColumn  Binding="{Binding Path=GPRODUCER}" Header="计划织厂" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=SPRODUCER}" Header="计划浆厂" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=ABPSOLLMENGE1}" Header="计划经长" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=ABPSOLLMENGE8}" Header="计划轴数" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=ABPERLDAT}" Header="实际回轴日期" MinWidth="80" Width="SizeToCells"  />
                        <!--交期	客户	下单日期	销售单号	品种	指定对缸号	ERP浆纱单号	排浆纱日期	计划织造厂	计划浆纱厂	计划经长	计划轴数	预计浆纱回轴日期	后整厂	等料码长
                        <DataGridTextColumn  Binding="{Binding Path=GWARPYARNINFO}" Header="是否欠纱" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=VKPWUTERM}" Header="交期" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=VKPAUFNUM}" Header="销售单号" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn   Binding="{Binding Path=ABPLIEFDAT}" Header="预计回轴日期" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn  Binding="{Binding Path=GMETER}" Header="等料码厂" MinWidth="80" Width="SizeToCells"  />
                        -->
                    </DataGrid.Columns>
                </fd:FilteringDataGrid>
            </Expander>
            <!--fd:FilteringDataGrid
          Grid.Row="2"
          AutoGenerateColumns="True" EnableRowVirtualization="True"  
                                              ItemsSource="{Binding}" 
                                              x:Name="SndDg" 
                                                 CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="1000"
                                              Height="300"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
            </fd:FilteringDataGrid-->
        </StackPanel>
    </Grid>
</local:DocumentBase>
